package com.ivanceras.client.widgets;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Widget;

public class AdMenuUi extends Composite implements HasText{

	private static AdMenuUiUiBinder uiBinder = GWT
			.create(AdMenuUiUiBinder.class);

	interface AdMenuUiUiBinder extends UiBinder<Widget, AdMenuUi> {
	}

	public AdMenuUi(String text) {
		initWidget(uiBinder.createAndBindUi(this));
		setText(text);
	}

	@UiField Anchor menu;
	
	@Override
	public String getText() {
		return menu.getText();
	}

	@Override
	public void setText(String text) {
		menu.setHTML(text);
		menu.setHref("#");
	}
	
	public void setClickHanlder(ClickHandler handler){
		menu.addClickHandler(handler);
	}
	

}
